package com.sunther.document.controller;

import com.sunther.document.service.FileTagService;
import com.sunther.idb.common.util.WebResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author csb
 * @description: TODO
 * @date 2023/5/25 15:19
 */
@RestController
@RequestMapping("/file_tag")
public class FileTagController {

    @Autowired
    private FileTagService fileTagService;

    @GetMapping("/list")
    public WebResult list(@RequestParam(required = false) String keyword,
                          @RequestParam(required = false) String projectId) {
        try {
            return WebResult.success("操作成功",fileTagService.listByKeyword(keyword,projectId));
        }catch (Exception e) {
            return WebResult.failure("操作失败");
        }

    }
}
